$INCLUDE: 'C:\FG\FASTGRAF.FI'

      PROGRAM MAIN

      INTEGER OLD_MODE
      INTEGER ACTIVE, VISUAL
      INTEGER PAGE0, PAGE1
      INTEGER STATUS
      INTEGER FG_ALLOCATE, FG_FREEPAGE
      INTEGER FG_GETADDR, FG_GETMODE, FG_GETPAGE, FG_GETVPAGE

      CALL FG_INITPM
      OLD_MODE = FG_GETMODE()
      CALL FG_SETMODE(4)
      STATUS = FG_ALLOCATE(1)
      CALL FG_SETPAGE(1)

      ACTIVE = FG_GETPAGE()
      VISUAL = FG_GETVPAGE()

      CALL FG_SETPAGE(0)
      PAGE0 = FG_GETADDR()
      CALL FG_SETPAGE(1)
      PAGE1 = FG_GETADDR()

      STATUS = FG_FREEPAGE(1)
      CALL FG_SETMODE(OLD_MODE)
      CALL FG_RESET

      WRITE(6,1000) ACTIVE
      WRITE(6,1010) VISUAL
      WRITE(6,1020) PAGE0
      WRITE(6,1030) PAGE1

      STOP ' '
1000  FORMAT(' Active page is',I2,'.')
1010  FORMAT(' Visual page is',I2,'.')
1020  FORMAT(' Page 0 address is ',Z4)
1030  FORMAT(' Page 1 address is ',Z4)
      END
